package org.swingannotations.impl;

import java.awt.Container;
import java.util.HashSet;
import java.util.Vector;

public class AnnotationProcessor {

	ComponentCatalog componentCatalog = new ComponentCatalog();
	SwingContainerSearcher containerSearcher = new SwingContainerSearcher(componentCatalog);
	
	
	
	
	public void process()
	{
		JReferenceProcessor jReference = new JReferenceProcessor(containerSearcher,componentCatalog);
		jReference.processAnnotations();
	}
	
	
	public void addController(Object controller)
	{
		componentCatalog.addController(controller);
	}
	
	
	
	public void addViewClass( Class<? extends Container> viewClass) throws Exception
	{
		// create an instance of this view class using the
		// default constructor.
		addView(viewClass.getConstructor(new Class[] {}).newInstance(new Object[]{}));
		
	}
	public void addView(Container view)
	{
		componentCatalog.addContainer(view);
	}



	public ComponentCatalog getComponentCatalog() {
		return componentCatalog;
	}



	public void setComponentCatalog(ComponentCatalog componentCatalog) {
		this.componentCatalog = componentCatalog;
	}



	public SwingContainerSearcher getContainerSearcher() {
		return containerSearcher;
	}



	public void setContainerSearcher(SwingContainerSearcher containerSearcher) {
		this.containerSearcher = containerSearcher;
	}
	
	
	
	
	
}
